using Circus.CodeEditor;
using Circus.CodeEditor.Serialization;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
namespace Circus.CodeEditor
{
	[Serializable]
	public class EditLineStyles : List<EditLineStyle>,IList<EditLineStyle>, ICollection<EditLineStyle>, IEnumerable<EditLineStyle>, IEnumerable
	{
		private CodeEditor owner;
		public new EditLineStyle this[int Index]
		{
			get
			{
				return (Index >= 0 && Index < base.Count) ? base[Index] : null;
			}
			set
			{
				base[Index] = value;
			}
		}
		
		public EditLineStyles()
		{
		}
		public EditLineStyles(CodeEditor owner)
		{
			this.owner = owner;
		}
		public virtual void Assign(EditLineStyles source)
		{
			base.Clear();
			foreach (EditLineStyle current in source)
			{
				this.AddLineStyle(current.Name, current.ForeColor, current.BackColor, current.PenColor, current.ImageIndex, current.Options);
			}
		}
		public virtual int IndexOfName(string name)
		{
			int result;
			for (int i = 0; i < base.Count; i++)
			{
				if (this[i].Name == name)
				{
					result = i;
					return result;
				}
			}
			result = -1;
			return result;
		}
		public virtual int AddLineStyle()
		{
			base.Add(new EditLineStyle(this.owner));
			return base.Count - 1;
		}
		public virtual int AddLineStyle(string name, Color foreColor, Color backColor, Color penColor, int imageIndex, LineStyleOptions options)
		{
			base.Add(new EditLineStyle(this.owner, name, foreColor, backColor, penColor, imageIndex, options));
			return base.Count - 1;
		}
	}
}
